package com.ad_hccm.dao.TreatmentHistory;

import com.ad_hccm.domain.TreatmentHistory.SystemMedicine;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 系统药物Dao
 */
@Mapper
public interface SystemMedicineDao {
    @Insert("insert into system_medicine value(#{id}, #{sodiumThiosulfate}, #{calciumSupplementsVitaminC}, #{compoundGlycyrrhetinicAcidGlycoside}, #{isHormone}, #{hormon}, #{isBiologicalAgents}, #{BiologicalAgents})")
    public boolean save(SystemMedicine systemMedicine);

    @Update("update system_medicine set sodiumThiosulfate = #{sodiumThiosulfate}, calciumSupplementsVitaminC = #{calciumSupplementsVitaminC}, compoundGlycyrrhetinicAcidGlycoside = #{compoundGlycyrrhetinicAcidGlycoside}, isHormone = #{isHormone}, hormon = #{hormon}, isBiologicalAgents = #{isBiologicalAgents}, BiologicalAgents = #{BiologicalAgents} where id=#{id}")
    public boolean update(SystemMedicine systemMedicine);

    @Select("select * from system_medicine where id=#{id}")
    public SystemMedicine getById(String id);

    @Select("select * from system_medicine")
    public List<SystemMedicine> getAll();
}